import request, { download } from '@/utils/request'

/**
 * 定时任务执行日志表 Api
 *
 * @author EasyAdmin ( 1073602@qq.com )
 * @date 2025-11-17
 */
export default {

    /**
     * 分页查询
     * @param query 查询参数
     */
    page: (query: any) => {
        return request.get('/admin/job/log/page',{params: query})
    },

    /**
     * 查询列表
     * @param query 查询参数
     */
    list: (query: any) => {
        return request.get('/admin/job/log/list',{params: query})
    },

    /**
     * 查询详细
     * @param query 查询参数
     */
    getById: (id: string) => {
        return request.get(`/admin/job/log/${id}`)
    },


    /**
     * 删除
     * @param ids 删除Ids
     */
    delete: (ids: any) => {
        return request.delete(`/admin/job/log/${ids}`)
    },

    /**
     * 导出Excel
     * @param filename Excel文件名称
     * @param query 查询参数
     */
	download: (query: any, filename: string) => {
		download("/admin/job/log/export", { ...query }, `${filename}.xlsx`,{});
	},

    /**
     * 清空定时任务执行日志数据
     * @param jobId 任务ID
     */
    cleanByJobId: (jobId: string) => {
        return request.delete(`/admin/job/log/clean/${jobId}`)
    }

}